﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:EIA.SLClient.ProjectManage.Contract"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
	xmlns:EIA_SLClient_Utility_Behaviors="clr-namespace:EIA.SLClient.Utility.Behaviors;assembly=EIA.SLClient.Utility"
	mc:Ignorable="d"
	x:Class="EIA.SLClient.ProjectManage.Contract.ProjectContractView"
	d:DesignWidth="1024" d:DesignHeight="600">
	<UserControl.Resources>
		<local:ProjectContractViewModel x:Key="ProjectContractViewModelDataSource" />
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource ProjectContractViewModelDataSource}}">
		<i:Interaction.Triggers>
			<i:EventTrigger>
				<ei:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="OnLoad"/>
			</i:EventTrigger>
		</i:Interaction.Triggers>
		<Grid Height="260" VerticalAlignment="Top" Width="800" HorizontalAlignment="Center">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="120"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="120"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="120"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
				<RowDefinition Height="*"/>
				<RowDefinition Height="*"/>
				<RowDefinition Height="*"/>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
			<TextBlock TextWrapping="Wrap" Text="合同编号" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0"/>
			<TextBlock TextWrapping="Wrap" Text="项目投资额" VerticalAlignment="Center" HorizontalAlignment="Right" d:LayoutOverrides="HorizontalAlignment" Grid.Row="1" Margin="0"/>
			<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" VerticalAlignment="Center" Text="合同金额" Grid.Column="2" Margin="0" Grid.Row="1"/>
			<TextBlock TextWrapping="Wrap" Text="签订主体" HorizontalAlignment="Right" Grid.Row="2" VerticalAlignment="Center" Margin="0"/>
			<TextBlock TextWrapping="Wrap" Text="工作量比例" VerticalAlignment="Center" Grid.Column="2" Grid.Row="2" HorizontalAlignment="Right" Margin="0"/>
			<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" Text="委托比例" Grid.Column="4" Grid.Row="2" VerticalAlignment="Center" Margin="0"/>
			<TextBlock Margin="0" TextWrapping="Wrap" Text="签订时间" HorizontalAlignment="Right" Grid.Row="3" VerticalAlignment="Center"/>
			<TextBlock TextWrapping="Wrap" Text="生效时间" HorizontalAlignment="Right" Grid.Row="3" VerticalAlignment="Center" Grid.Column="2" Margin="0"/>
			<TextBox Margin="8,0,0,0" TextWrapping="Wrap" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Width="387" Grid.ColumnSpan="3" Text="{Binding Model.ContractNo, Mode=TwoWay}" IsReadOnly="{Binding IsEditing, Converter={StaticResource BoolenRevertConverter}, Mode=OneWay}"/>
			<TextBox Margin="8,0,0,0" TextWrapping="Wrap" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Width="80" Grid.Row="1" Text="{Binding Model.InvestedAmount, Mode=TwoWay}" IsReadOnly="{Binding IsEditing, Converter={StaticResource BoolenRevertConverter}, Mode=OneWay}"/>
			<TextBox Margin="8,0,0,0" TextWrapping="Wrap" Width="80" HorizontalAlignment="Left" Grid.Column="3" VerticalAlignment="Center" Grid.Row="1" Text="{Binding Model.ContractAmount, Mode=TwoWay}" IsReadOnly="{Binding IsEditing, Converter={StaticResource BoolenRevertConverter}, Mode=OneWay}"/>
			<ComboBox ItemsSource="{Binding HTQDZTCollection, Source={StaticResource ListsResource}}" Margin="8,0,0,0" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Width="120" IsEnabled="{Binding IsEditing, Mode=OneWay}" SelectedItem="{Binding HTQDZT, Mode=TwoWay}" DisplayMemberPath="DicIname"/>
			<TextBox Margin="8,0,0,0" TextWrapping="Wrap" Width="80" HorizontalAlignment="Left" Grid.Column="3" Grid.Row="2" VerticalAlignment="Center" Text="{Binding Model.PrjWorkAmountRate, Converter={StaticResource PercentageConverter}, Mode=TwoWay}" IsReadOnly="{Binding IsEditing, Converter={StaticResource BoolenRevertConverter}, Mode=OneWay}"/>
			<TextBox Margin="8,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="5" Grid.Row="2" HorizontalAlignment="Left" Width="80" Text="{Binding Model.PrjContractAmountRate, Converter={StaticResource PercentageConverter}, Mode=TwoWay}" IsReadOnly="{Binding IsEditing, Converter={StaticResource BoolenRevertConverter}, Mode=OneWay}"/>
			<sdk:DatePicker Margin="8,0,0,0" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" VerticalAlignment="Center" SelectedDate="{Binding Model.SignedDate, Mode=TwoWay}" IsEnabled="{Binding IsEditing, Mode=OneWay}"/>
			<sdk:DatePicker Margin="8,0,0,0" Grid.Column="3" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left" SelectedDate="{Binding Model.ValidDate, Mode=TwoWay}" IsEnabled="{Binding IsEditing, Mode=OneWay}"/>
			<TextBlock HorizontalAlignment="Left" Margin="92,0,0,0" TextWrapping="Wrap" Text="(万元)" Grid.Column="1" Grid.Row="1" d:LayoutOverrides="Height" VerticalAlignment="Center"/>
			<TextBlock HorizontalAlignment="Left" Margin="92,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center" Text="(万元)" Grid.Column="3" Grid.Row="1"/>
			<TextBlock Grid.Column="3" HorizontalAlignment="Left" Margin="92,0,0,0" Grid.Row="2" TextWrapping="Wrap" Text="%" d:LayoutOverrides="Height" VerticalAlignment="Center"/>
			<TextBlock Grid.Column="5" HorizontalAlignment="Left" Margin="92,0,0,0" Grid.Row="2" TextWrapping="Wrap" Text="%" d:LayoutOverrides="Height" VerticalAlignment="Center"/>
			<Grid Grid.ColumnSpan="6" Grid.Row="4">
				<Button Content="保存" BorderThickness="0" Padding="0" Style="{StaticResource bs_clear}" Command="{Binding SaveCommand}" Margin="0,0,240,0" FontSize="14.667" HorizontalAlignment="Right" Width="120" Foreground="White" VerticalAlignment="Center" Height="30" IsEnabled="{Binding IsEditing, Mode=OneWay}" Visibility="{Binding IsEditing, Converter={StaticResource Bool2VisibilityConverter}, Mode=OneWay}">
					<Button.Background>
						<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
					</Button.Background>
					<i:Interaction.Behaviors>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png" Opacity="0.4"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
					</i:Interaction.Behaviors>
				</Button>
				<Button Content="取消" BorderThickness="0" Padding="0" Style="{StaticResource bs_clear}" Command="{Binding CancelCommand}" Margin="0,0,56,0" FontSize="14.667" HorizontalAlignment="Right" Width="120" Foreground="#FF4C4C4C" VerticalAlignment="Center" Height="30" IsEnabled="{Binding IsEditing, Mode=OneWay}" Visibility="{Binding IsEditing, Converter={StaticResource Bool2VisibilityConverter}, Mode=OneWay}">
					<Button.Background>
						<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-1.png"/>
					</Button.Background>
					<i:Interaction.Behaviors>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-1.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-1.png" Opacity="0.4"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
					</i:Interaction.Behaviors>
				</Button>
				<Button Content="编辑" BorderThickness="0" Padding="0" Style="{StaticResource bs_clear}" Command="{Binding EditCommand}" Margin="0,0,56,0" FontSize="14.667" HorizontalAlignment="Right" Width="120" Foreground="White" VerticalAlignment="Center" Height="30" IsEnabled="{Binding IsEditing, Converter={StaticResource BoolenRevertConverter}, Mode=OneWay}" Visibility="{Binding IsEditing, ConverterParameter=f, Converter={StaticResource Bool2VisibilityConverter}, Mode=OneWay}">
					<Button.Background>
						<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
					</Button.Background>
					<i:Interaction.Behaviors>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png" Opacity="0.4"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
					</i:Interaction.Behaviors>
				</Button>
			</Grid>
		</Grid>
	</Grid>
</UserControl>
